package dao

import (
	"context"

	"gitee.com/krio/grpc-common/model"
)

type RegionDao struct {
}

func (d *RegionDao) Add(ctx context.Context, req *model.Region) (int32, error) {
	_, err = x.Table(model.TableRegion).Insert(req)
	if err != nil {
		return 0, err
	}
	return req.ID, nil
}
